package d2_reflect;

public class Dog {


    //添加成员变量
    private int age;
    private String name;
    public static int onLineName;
    public static final String NAME = "陈平安";

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static int getOnLineName() {
        return onLineName;
    }

    public static void setOnLineName(int onLineName) {
        Dog.onLineName = onLineName;
    }

    private void run() {
        System.out.println("狗跑的贼快~~");
    }

    public void eat() {
        System.out.println("--狗吃骨头--");
    }

    private String eat(String name) {
        return "狗吃" + name;
    }



    //无参构造器
    public Dog() {
    }

    //有参构造器
    public Dog(int age, String name) {
        this.age = age;
        this.name = name;
    }

    @Override
    public String toString() {
        return "Student{" +
                "age=" + age +
                ", name='" + name + '\'' +
                '}';
    }
}
